package com.oig.sys.auth.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;

import lombok.Data;

import java.util.Date;
import java.util.List;


@Data
@Schema(description = "部门详细信息")
public class DepartmentVo {

    @Schema(description = "主键id")
    private Integer id;

    @Schema(description = "所属租户id")
    private Integer tenantId;
    @Schema(description = "所属租户编码")
    private String tenantCode;
    @Schema(description = "所属租户")
    private String tenantName;

    @Schema(description = "部门编码")
    private String departCode;
    @Schema(description = "部门名称")
    private String departName;

    @Schema(description = "部门管理人id")
    private Integer masterId ;
    @Schema(description = "部门管理人")
    private String masterName;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Schema(description = "部门成立时间")
    private Date establishTime;

    @Schema(description = "状态")
    private String status;

    @Schema(description = "上级部门id")
    private Integer parentId ;
    @Schema(description = "上级部门名称,不填时，默认为空")
    private String parentName ;

    @Schema(description = "创建人")
    private String createUserName;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Schema(description = "创建时间")
    private Date createTime;

    @Schema(description = "最后更新人")
    private String lastUpdateName;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Schema(description = "最后更新时间")
    private Date lastUpdateTime;

    @Schema(description = "部门人员")
    private List<UserVo> userList;

    @Schema(description = "下级部门")
    private List<DepartmentVo> children;

    public DepartmentVo(){}

    public DepartmentVo(Integer id, Integer tenantId,String tenantCode, String tenantName, String departCode, String departName,Integer masterId,
                        String masterName, Date establishTime, String status, Integer parentId, String parentName){
        this.id = id;
        this.tenantId = tenantId;
        this.tenantCode = tenantCode;
        this.tenantName = tenantName;
        this.departCode = departCode;
        this.departName = departName;
        this.masterId = masterId;
        this.masterName = masterName;
        this.establishTime = establishTime;
        this.status = status;
        this.parentId = parentId;
        this.parentName = parentName;
    }

    public DepartmentVo(Integer id, Integer tenantId, String tenantCode, String tenantName, String departCode, String departName,Integer masterId,
                        String masterName, Date establishTime, String status, Integer parentId,String parentName,
                        String createUserName,Date createTime, String lastUpdateName,Date lastUpdateTime){
        this.id = id;
        this.tenantId = tenantId;
        this.tenantCode = tenantCode;
        this.tenantName = tenantName;
        this.departCode = departCode;
        this.departName = departName;
        this.masterId = masterId;
        this.masterName = masterName;
        this.establishTime = establishTime;
        this.status = status;
        this.parentId = parentId;
        this.parentName = parentName;
        this.createUserName = createUserName;
        this.createTime = createTime;
        this.lastUpdateName = lastUpdateName;
        this.lastUpdateTime = lastUpdateTime;
    }
}
